-
-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make session cookie use ASGI root path #1147
Make session cookie use ASGI root path #1147
Conversation
Thanks, this seems like a reasonable improvement. It does need a test, I think, though. |
Co-authored-by: Tom Christie <tom@tomchristie.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the final remaining suggestion is addressed I'm probably okay with pulling this in.
It could potentially use a test case, but it's probably also okay enough without.
I'm going to add a test and then we can merge this, thanks for the quick response! |
I couldn't find a way to set the root path directly on the app so I had to mount another app on the main one and tested that, seems to work as expected. |
Ah fantastic, yup. |
@mahmoudhossam or @tomchristie This update broke my session checking function to ensure users are logged in. I mount all the sub routes (users, etc..). The request.session has data in it when set, but when I redirect back to the start page then session is now null. I see no documentation on how to have the session across Mounts? Below is example of what I am doing...
|
I think there should be a difference between mounting routes and mounting whole applications. I'd expect routes to share everything with the parent application, but submounted applications should have their own session. @tomchristie thoughts? |
I agree, the documentation shows using Mount with a sub app (Mount("/static", app=StaticFiles(directory="static"), name="static"), but without defining "app=x" it is just Submounting routes. For the session, it should check if submounted as an app or route. |
@devsetgo I'd say open a new issue describing your use case and make sure to mention that this PR broke your flow so it'd be easy to track for the maintainers. This PR is already closed and I don't think anyone will be checking it anymore. |
Okay folks - got a resolution to this here... #1512 |
Fixes #233